<template>
	<view class="home">
		<view v-for="v in activeData" :key="v.id">
			<view class="body">
				<text>{{v.title}}</text>
				<text>{{v.author.authorType}} {{v.date}}</text>
			</view>
			<view class="body2"></view>
			<view class="body3">
				<span>
					{{v.detail}}
				</span>
			</view>
		</view>

	</view>
</template>

<script>
	import {
		http
	} from "../../utils/http.js"
	export default {
		data() {
			return {
				title: "",
				activeData: [],
			};
		},
		methods: {
			getData() {
				http({
					url: "/activity/list",
					method: "get",
					params: {
						page: 1,
						limit: 2,
						title: this.title
					}
				}).then((res) => {
					// console.log(res)
					if (res.code == 0) {
						this.activeData = res.data;
					} else {
						console.log("数据接收失败")
					}

				})

			}
		},
		onLoad(option) {
			this.title = option.title;
			this.getData();
			// console.log(this.title)
		},
	}
</script>

<style lang="less">
	.home {
		padding: 40rpx;
		display: flex;
		flex-direction: column;

		.body {
			height: 160rpx;
			display: flex;
			flex-direction: column;
			justify-content: center;

			text:nth-child(2) {
				font-size: 20rpx;
				color: #a2a2a2;
				margin-top: 25rpx;
			}
		}

		.body2 {
			width: 680rpx;
			height: 280rpx;
			background-color: #e4f0ff;
			border-radius: 15rpx;
		}
	}
</style>
